package org.insia.smartposse.dao;

import java.util.ArrayList;
import java.util.List;

import org.insia.smartposse.idao.ISkillDAO;
import org.insia.smartposse.metier.Skill;
/**
 * DAO for Skill class.
 * @author sok hout
 *
 */
public class SkillDAO 
extends GenericDAO<Skill, Long> 
implements ISkillDAO {
	/**
	 * Empty constructor
	 *
	 */
	public SkillDAO() {
		type = Skill.class;
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.idao.ISkillDAO#getSkillWithoutCategory()
	 */
	@SuppressWarnings("unchecked")
	public List<Skill> getSkillWithoutCategory() {
		List<Skill> lskill = new ArrayList<Skill>();
		try {
			List<Skill> lskilltmp= (List<Skill>)_SESSION.createQuery("from Skill as skill where skill.category is null").list();
			if (lskilltmp != null)
				lskill = lskilltmp;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return lskill;
	}
}
